<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>用户名</td>
                    <td>
                        <input type="text" v-model="list.username">
                    </td>
                </tr>
                <tr>
                    <td>密码</td>
                    <td>
                        <input type="password" v-model="list.userpwd">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" class="btn btn-primary" value="登录" @click="login" >
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import{ref,reactive}from 'vue'

let list=reactive({
    username:'',
    userpwd:'',
})

const login=()=>{
    if(list.username=="")
    {   
        alert("用户名不能为空");
        return;
    }
    if(list.userpwd==""){
        alert("密码不能为空");
        return;
    }
}


</script>

<style scoped>

</style>